package jzbank.job;

import jzbank.dao.serializabledao.TaskDao;

import jzbank.dao.serializabledao.impl.TaskDaoImpl;
import jzbank.pojo.vo.TaskInfo;
import org.quartz.*;
import org.springframework.beans.factory.annotation.Autowired;


public class DemoJob implements Job {

    TaskDao taskDao=new TaskDaoImpl();


    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        //1.获取保存的灵活参数
        //2.加载根据灵活参数封装方法
        //3.
        JobDetail jobDetail = jobExecutionContext.getJobDetail();
        String taskName = jobDetail.getKey().getName();
        System.out.println("taskname="+taskName);
        //获取任务参数
        TaskInfo taskInfoByName = taskDao.getTaskInfoByName(taskName);
        System.out.println(taskInfoByName.toString());

    }



}
